import random


# 函数
# 形参和返回值全部动态
# 缺省参数跟C++一样
def range_sum(begin=1, end=4):
    total = 0
    for e in range(begin, end):
        total += e
    return total


def is_odd(num):
    if num % 2:
        return 1
    return 0


# 可以返回多个值!
def get_two_randon_int():
    num2 = random.randint
    num1 = random.randint
    return num1, num2


# 多元赋值的接收,可用下划线占位
a, b = get_two_randon_int()
c, _ = get_two_randon_int()
print(range_sum(2))
print(is_odd(0))
print(is_odd(1))
print(is_odd(2))

